
import { get, getBuffer, postJson, postFile, del } from "../http";
let api = process.env.VUE_APP_API;
if (process.env.VUE_APP_Mock === "true") {
  api = "/mock/";
}

// 获取设备列表
export const deviceList = async (p) => await get(`${api}/witness/device/list`, p);
// 获取房间的列表
export const getListRoom = async (p) => await get(`${api}/witness/track/listRoom`,p);
// 获取房间设备列表（层级关系）
export const deviceLevelList = async (p) => await get(`${api}/witness/device/listRoomDevice`, p);
// 获取摄像头播放地址deviceId
export const getPlayUrl = async (p) => await get(`${api}/witness/device/getPlayUrl/${p}`);
// 搜索房间 参数word
export const searchRoomList = async (p) => await get(`${api}/witness/device/listRoom`, p);

export const deviceGetPlayUrl = async (p) => await get(`${api}/witness/device/getPreviewURLs`,p);

// 获取KB PB 项目信息
export const witnessSubtasklistpart = (data) => postJson(`${api}/witness/subtask/list/part`,data);
// 停止摄像头
export const witnessDeviceStopPlay = (data) => postJson(`${api}/witness/device/stopPlay`,data)
// /gdw/witness/device/listRoomDevice?taskType=PB&status=JZZ&deviceType=PC
